package com.aruba.iocapplication

import android.annotation.SuppressLint
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.View
import android.widget.TextView
import android.widget.Toast
import com.aruba.ioclib.BaseActivity
import com.aruba.ioclib.annotations.BindID
import com.aruba.ioclib.annotations.ContentView
import com.aruba.ioclib.annotations.OnClick

@ContentView(R.layout.activity_main)
class MainActivity : BaseActivity() {
    @BindID(R.id.tv_hello)
    val tvHello: TextView? = null

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        tvHello?.apply {
            text = "hello inject"
        }
//        tvHello?.setOnClickListener(object : View.OnClickListener {
//            override fun onClick(p0: View?) {
//                TODO("Not yet implemented")
//            }
//        })
    }

    @OnClick(R.id.tv_hello, R.id.tv_hello2)
    fun clickView(view: View) {
        Toast.makeText(this, (view as TextView).text, Toast.LENGTH_SHORT).show()
    }
}